﻿@{
	Layout = "~/Views/Shared/_Layout.cshtml";
}

@model dPet.Application.DataObjects.StaffDto

<div class="page-header">
	<h3>修改个人信息</h3>
</div>

@using (Html.BeginForm("SaveProfile", "Account", FormMethod.Post, new { onsubmit = "return check_form()" }))
{
	<div class="panel panel-default" style="max-width:600px;">
		<div class="panel-heading">
			&nbsp;
		</div>

		<div class="panel-body form-horizontal">
			<div class="form-group">
				<label for="Name" class="col-md-2 control-label">登录邮箱</label>
				<div class="col-md-7">
					<p class="form-control-static">@Model.LoginName</p>
				</div>
			</div>
			<div class="form-group">
				<label for="Name" class="col-md-2 control-label">当前角色</label>
				<div class="col-md-7">
					<p class="form-control-static">@Model.StaffRole.Name</p>
				</div>
			</div>
			<div class="form-group">
				<label for="Name" class="col-md-2 control-label">姓　　名</label>
				<div class="col-md-7">
					@Html.TextBoxFor(x => x.Name, new { @class = "form-control", placeholder = "请输入姓名" })
				</div>
			</div>

			<div class="form-group">
				<label for="Contact" class="col-md-2 control-label">联系方式</label>
				<div class="col-md-7">
					@Html.TextBoxFor(x => x.Contact, new { @class = "form-control", placeholder = "请输入联系方式" })
				</div>
			</div>

			<div class="form-group">
				<div class="col-md-offset-2 col-md-7">
					<button type="submit" class="btn btn-info btn-sm"><span class="glyphicon glyphicon-floppy-disk"></span> 保 存</button>
				</div>
			</div>
		</div>
	</div>
}

@section scripts {
	<script type="text/javascript">
		function check_form() {
			if ($("#Name").val() == '') {
				alert("请输入姓名");
				$("#Name").focus();
				return false;
			}

			return true;
		}
	</script>
}
